from collections import namedtuple


Person = namedtuple("Person", "name age weight")
person = Person('thomas', 18, 120)
print(type(person), person)
print(person.name, person.age, person.weight)
print(person._asdict(), person._asdict()['name'], person._asdict()['weight'])
person._asdict()['name2'] = 'python'
print(person._asdict())